package com.travelzen._15.generic;

import java.util.Iterator;

public class TestForEach implements Iterable<String> {

	@Override
	public Iterator<String> iterator() {
		return new InIterator();
	}

	class InIterator implements Iterator<String> {

		@Override
		public boolean hasNext() {
			return true;
		}

		@Override
		public String next() {
			return "hahaha";
		}

		@Override
		public void remove() {
		}

	}

	public static void main(String[] args) {
		TestForEach t = new TestForEach();
		for (String string : t) {
			System.out.println(string);
		}
	}
}
